/*
 * $Id: AppEnv.h,v 1.2 2005-07-28 08:53:49 bacon Exp $
 */

#ifndef _APPENV_CLASS_
#define _APPENV_CLASS_

#include <xpp/bas/String.h>
#include <xpp/utl/SkvEnv.h>
#include <xpp/utl/SkvEnvPath.h>
#include <xpp/net/TcpAddress.h>
#include <xpp/sys/Path.h>
#include <xp/bas/time.h>

using namespace xpp::bas;
using namespace xpp::utl;
using namespace xpp::net;
using namespace xpp::sys;

class AppEnv: public SkvEnv 
{
public:
	AppEnv (xp_size_t mpb_size = 0);

	void preLoad ();
	void postLoad ();

	bool gateEnableTcp () const
	{
		return gate_enable_tcp;
	}

	const xp_char_t* gateTcpService () const 
	{
		return gate_tcp_service;
	}

	bool gateTcpLocalOnly () const
	{
		return gate_tcp_local_only;
	}

	unsigned int gateMaxConnections () const
	{
		return gate_max_connections;
	}

	xp_time_t gateTimeout () const
	{
		return gate_timeout;
	}

protected:
	bool gate_enable_tcp;

	xp_char_t gate_tcp_service[TcpAddress::MAX_SERVICE_LEN];
	bool gate_tcp_local_only;
	unsigned int gate_max_connections;
	xp_time_t gate_timeout;

private:
	int probe_logging_target       (const xp_char_t* v);
	int probe_logging_level        (const xp_char_t* v);

	int probe_gate_enable_tcp      (const xp_char_t* v);
	int probe_gate_tcp_service     (const xp_char_t* v);
	int probe_gate_tcp_local_only  (const xp_char_t* v);
	int probe_gate_max_connections (const xp_char_t* v);
	int probe_gate_timeout         (const xp_char_t* v);
};

typedef SkvEnvPath AppEnvPath;

#endif
